﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL.Progect;
using BLL.Order;
using BLL.View;

namespace HQWeb.View.Order
{
    public partial class DeleteOrder : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            VerdictIsLogin();
            if (!IsPostBack)
            {
                string strID = Request["id"].Trim();           //订单
                texOrderid.Value = strID;
                Model.Order.T_PUB_ORDER model2 = new Model.Order.T_PUB_ORDER();
                T_PUB_ORDER modell = new T_PUB_ORDER();
                model2 = modell.GetModelByID(strID);
                //texcustomerid.Value = model2.CUSTOMER_ID; 
                Model.View.T_PUB_CUSTOMERINFO model3 = new Model.View.T_PUB_CUSTOMERINFO();
                BLL.View.T_PUB_CUSTOMERINFO CUSTOMERINFO_BLL = new T_PUB_CUSTOMERINFO();
                model3 = CUSTOMERINFO_BLL.GetModel(model2.CUSTOMER_ID);
                labBRIDEPHONE.Text = model3.BRIDEPHONE;
                labBRIDE_NAME.Text = model3.BRIDE_NAME;
                labGROOM_NAME.Text = model3.GROOM_NAME;
                labGROOMPHONE.Text = model3.GROOMPHONE;
                if (model3.TIME != null)
                {
                    labTIME.Text = Convert.ToDateTime(model3.TIME).ToShortDateString();
                }
            }
        }

        protected void butSubmit_Click(object sender, EventArgs e)
        {
            string strID = texOrderid.Value;
            Model.Order.T_PUB_ORDER model2 = new Model.Order.T_PUB_ORDER();
            T_PUB_ORDER modell = new T_PUB_ORDER();
            model2 = modell.GetModelByID(strID);
            model2.IsDelete = "1";
            model2.DeleteReason = texreason.Text.Trim();
            model2.DeleteTime = DateTime.Now;
            model2.DeleteUser = Convert.ToInt32(Session["USER_ID"]);
            modell.Update(model2);
            Universal.JS.RunJS("  Close();");
        }


    }
}